package com.linkwings.dbTemp;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.linkwings.dbTemp.DataBaseManager;
import com.linkwings.dbTemp.PageContainer;
import com.linkwings.dbTemp.ParameterException;

public interface EntityDao<T> {
	
	public int countDataSize(final String query, final Object[] params) ;
	
	public int executeUpdate(final String query, final Object[] params) ;
	
	@Deprecated
	public List executeQueryList(final String query, final Object[] params) ;
	
	@Deprecated
	public List executeQueryList(final String query, final Object[] params, Integer offset, Integer pageSize) ;
	
	public DataBaseManager executeQueryBySql(final String sql,final Object[] params);
	
	public DataBaseManager executeBySql(final String sql, final Object[] params);
	
	public DataBaseManager executeQueryBySql(final String sql, final Object[] params,Connection con2);
	
	public DataBaseManager executeBySql(final String sql, final Object[] params,Connection con2);
	
	public List sqlFindDateListMap(final String sql,final Object[] params) throws Exception;
	
	public List sqlFindDateListObject(final String sql,final Object[] params,Class arg) throws Exception;
	
	public List sqlFindDateListObject(final String sql,final Object[] params,Class arg,Map columnNameMap) throws Exception;
	
	public List sqlFindDateListMapperObject(final String sql,final Object[] params,Class arg) throws Exception;
	
	public List sqlFindDateListMapperObject(final String sql,final Object[] params,Class arg,String mapperFieldName) throws Exception;
	
	public void deleteObject(Object vo);
	
	public void deleteObjectByPk(Serializable pk) ; 
	
	public void deleteObjectByPk(Serializable pk,Class arg) ;
	
	public void deleteCollection(Collection dataList);	
	
	public T findObjectByPk(Serializable id) ;
	
	public Object findObjectByPk(Serializable id,Class arg);
	
	public T findObjectByQuery(final String query,final Object[] params);

	public List<T> findDataList(String query, Object[] params) ;	
	
	public List<T> findDataList(final String hql,final Object[] params, final Integer offset, final Integer pageSize);
	
	public PageContainer<T> findPageData(final String query,final Object[] params,final int offset,final int pageSize)throws ParameterException ;

	public PageContainer<T> findPageData(final String query,final String countquery,final Object[] params,final int offset,final int pageSize)throws ParameterException ;	
	
	public PageContainer<T> findPageData(final String query,final int count,final Object[] params,final int offset,final int pageSize)throws ParameterException ;	
	
	public PageContainer<T> findPageData_aotoset(final String query,final Object[] params,final int pageSize,HttpServletRequest request,String[] excludeURLParams) throws ParameterException;
	
	public PageContainer<T> findPageData_aotoset(final String query,final String countquery,final Object[] params,final int pageSize,HttpServletRequest request,String[] excludeURLParams)throws ParameterException ;
	
	public void saveOrUpdateCollection(Collection dataList) ;
	
	public void saveOrUpdate(Object vo) ;	
	
	public ResultSet callableExecute(final String callProc,final Object[] params,final int[] outParamsTypes);
	

}
